package com.jumi.microservice.domain.vo;

import com.jumi.microservice.common.base.AbstractObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 账号VO类
 *
 * @author Administrator
 */
@ApiModel(value = "账号值对象", description = "账号值对象")
public class UserAccountVO extends AbstractObject implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "用户账号")
    @NotNull(message = "用户账号不能为空")
    @Length(min = 3, max = 18, message = "用户账号格式必须是，字母+数字混排,3-18个字符")
    @Pattern(regexp = "^[a-zA-Z]+[0-9]*", message = "用户账号格式必须是，字母+数字混排,3-12个字符")
    private String userAccount;

    @ApiModelProperty(value = "用户姓名")
    @NotNull(message = "用户姓名不能为空")
    @Pattern(regexp = "^[\u4e00-\u9fa5]{2,10}$", message = "用户姓名格式必须是，汉字,2-10字符")
    private String userName;

    @ApiModelProperty(value = "用户密码")
//    @NotNull(message = "用户密码不能为空")
//    @Length(min = 6, max = 12, message = "用户密码格式必须是6-12字符")
    private String password;

    @ApiModelProperty(value = "手机号码")
    @NotNull(message = "手机号码不能为空")
    @Pattern(regexp = "^\\d{11}$", message = "手机号码格式必须是,11位手机号")
    private String mobile;

    @ApiModelProperty(value = "用户头像")
    private String userAvatar;

    @ApiModelProperty(value = "部门主键ID")
    //@NotNull(message = "选择部门不能为空")
    private Long departmentId;

    @ApiModelProperty(value = "角色")
    //@NotNull(message = "选择角色不能为空")
    private UserRoleVO roleRelations;

    @ApiModelProperty(value = "是部门负责人(0:否,1:是)")
    //@NotNull(message = "是否部门负责人不能为空")
    private Integer isLeader;

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getUserAvatar() {
        return userAvatar;
    }

    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar;
    }

    public Long getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
    }

    public UserRoleVO getRoleRelations() {
        return roleRelations;
    }

    public void setRoleRelations(UserRoleVO roleRelations) {
        this.roleRelations = roleRelations;
    }

    public Integer getIsLeader() {
        return isLeader;
    }

    public void setIsLeader(Integer isLeader) {
        this.isLeader = isLeader;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
